package router

import (
	"cron_table_admin/internal/api"
	"cron_table_admin/utils"

	"github.com/gin-gonic/gin"
)

func InitCronRouter(Router *gin.RouterGroup) {
	Router.POST("cron/create-task", utils.HandleError(api.CreateCorn))
	Router.POST("cron/update-task", utils.HandleError(api.UpdateCorn))
	Router.POST("cron/start-or-stop-task", utils.HandleError(api.StartOrStopCron))
	Router.POST("cron/execute-once-task", utils.HandleError(api.ExecuteOnceCron))
	Router.POST("cron/query-task", utils.HandleError(api.QueryCron))
	Router.GET("cron/get-task-detail", utils.HandleError(api.GetCronDetail))
}
